package monitor;

import java.util.*;

public class NodeList {
	public List<Node> nodeList;

	public NodeList() {
		super();
		nodeList = new ArrayList<Node>();
	}
	
	public void addNode(Node node) {
		nodeList.add(node);
	}
	
	public void removeNode(Node node) {
		nodeList.remove(node);
	}
	
	public void removeAllNodes(){
		nodeList.clear();
	}
	
	
	public void removeNodeId(int id){
		
		int size=nodeList.size();
		while(size>0){
			if(nodeList.get(size-1).getId()==id)
				nodeList.remove(size-1);
			
			size--;
			
		}
		
	}
	
	public Node getNode(int index) {
		return nodeList.get(index);
	}
	
	
	public int size() {
		return nodeList.size();
	}
}
